package com.lenovo.spider;

import cn.hutool.core.lang.Singleton;
import com.lenovo.spider.component.ProxyPool;
import redis.clients.jedis.JedisPool;

/**
 * 爬虫运行的上下文环境
 *
 * @author <a href="mailto:liuhan3@lenovo.com">HanL(liuhan3)</a>
 * on 2018/4/12 11:48
 */
public class Context {

    /**
     * 获取 JedisPool
     *
     * @return
     */
    public static JedisPool getJedisPool() {
        return Singleton.get(JedisPool.class,
                ConfigHolder.getString("redis.host", "localhost"),
                ConfigHolder.getInt("redis.port", 6379)
        );
    }

    public static ProxyPool getProxyPool() {
        return null;
    }
}
